package sg.edu.nus.iss.vmcs.machinery;

/*
 * Copyright 2011 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

/**
 * This class represents the door of the vending machine in simulation model VMCS.
 * It defines the logical description of the door object. It checks for the behavior
 * of the door object whether it is closed or open. The door object is instantiated
 * by {@link MachineryController}
 *
 * @version 1.0  07/12/2011
 * @author Team 7S - SE19
 * @see MachineryController
 */

public class Door {

	private boolean isClosed;

/**
 * Constructor of Door Class
 * Enables to create the new instance of Door
 */
	public Door() {
		isClosed = true;
	}

/**
 * This method sets the state of the door.
 * @param isClosed boolean Door Close or Open
 */
	
	public void setState(boolean isClosed) {
		System.out.println("Door.setState: " + isClosed);
		this.isClosed = isClosed;
	}

/**
 * This method return the current state of the Door object
 * @return isClosed boolean Door Close or Open
 */
	
	public boolean isDoorClosed() {
		return isClosed;
	}
}